package pers.ree.demo.designpattern.factory;

public class SimpleFactory {

    public AutoMobile createInstance(String type) {
        if ("car".equals(type)) {
            return new Car();
        }

        if ("truck".equals(type)) {
            return new Truck();
        }

        return new AutoMobileImpl();
    }
}
